package JasPerl::JSTL::Fmt::RequestEncodingTag;

use 5.010;
use strict;
use warnings;

use parent qw(JasPerl::TagExt::JspTag);

sub set_value {
    $_[0]->{value} = $_[1];
}

sub do_tag {
    my $self = shift;
    if (my $request = $self->get_request()) {
        # TODO: fallback encoding
        $request->set_character_encoding($self->{value});
    } else {
        die "not applicable";
    }
}

1;
